package com.demostic.demostic_test.ui;

import android.app.Dialog;
import android.content.Context;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;

public class MyDialog extends Dialog {
    public MyDialog(int screenWidth, int screenHeight, Context context, int widthOff, int heightOff, View layout, int style) {
        super(context, style);
        setContentView(layout);
        Window window = getWindow();
        WindowManager.LayoutParams params = window.getAttributes();
        params.width = screenWidth - widthOff;
        if (heightOff != 0) {
            params.height = screenHeight - heightOff;
        }
        params.gravity = 17;
        window.setAttributes(params);
    }
}
